Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web/react compiler #1109

Merged
merged 14 commits into from
Dec 13, 2024
Merged

Web/react compiler #1109

merged 14 commits into from
Dec 13, 2024

Conversation

suddenlyGiovanni
Copy link
Owner

@suddenlyGiovanni suddenlyGiovanni commented Dec 11, 2024

Introduction of React Compiler and fixes to how component are authored.

This pull request includes several changes to the apps/web and packages/ui directories to enhance ESLint configurations, update dependencies, and refactor React components by removing unnecessary memoization and simplifying state management.

ESLint Configuration and Dependency Updates:

  • apps/web/eslint.config.js: Added ESLint configurations for React and TypeScript, including plugins and rules for react-compiler.
  • apps/web/package.json: Updated dependencies to include vite-plugin-babel, @babel/preset-typescript, eslint-plugin-react, and eslint-plugin-react-compiler. [1] [2]
  • packages/ui/eslint.config.js: Added ESLint configurations for React and TypeScript, similar to apps/web.
  • packages/ui/package.json: Updated dependencies to align with the changes in apps/web, including eslint-plugin-react, eslint-plugin-react-compiler, and vite-plugin-babel. [1] [2]

React Component Refactoring:

Miscellaneous Changes:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 10 out of 10 changed files in this pull request and generated no suggestions.

Copy link

changeset-bot bot commented Dec 11, 2024

⚠️ No Changeset found

Latest commit: 304c097

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@acfb7ee). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff           @@
##             main   #1109   +/-   ##
======================================
  Coverage        ?   3.80%           
======================================
  Files           ?      45           
  Lines           ?    2732           
  Branches        ?      48           
======================================
  Hits            ?     104           
  Misses          ?    2628           
  Partials        ?       0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

socket-security bot commented Dec 11, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

Switch to using Babel for React compilation, removing
@vitejs/plugin-react-swc in favor of @vitejs/plugin-react. This
update includes setting up Babel plugins for React Compiler and
integrating ESLint support. These changes improve compatibility and
prepare for upcoming React features.

Signed-off-by: suddenlyGiovanni <[email protected]>
Add ESLint configuration to the UI package, enabling linting support
for React and TypeScript files. Installed new dependencies including
ESLint, eslint-plugin-react, and typescript-eslint to provide
extensive linting capabilities in the development environment.
Removed inline eslint-disable comments from accordion stories to
comply with the new linting rules.

Signed-off-by: suddenlyGiovanni <[email protected]>
Disabled the `react/no-unescaped-entities` rule in the ESLint
configuration for the UI package. Removed individual rule disablings
from Storybook story files, maintaining consistency and reducing
redundancy. This update streamlines ESLint configurations across
similar components.

Signed-off-by: suddenlyGiovanni <[email protected]>
Integrated `vite-plugin-babel` into the Vite config for enhanced
Babel processing, including support for TypeScript and React compiler
. Updated dependencies to incorporate Babel configurations and
necessary plugins.

Signed-off-by: suddenlyGiovanni <[email protected]>
    Integrated the `@storybook/addon-a11y` to enhance accessibility checks in the UI package. Additionally, enabled strict mode for the Storybook framework options to ensure stricter validation and development practices. Updated dependencies to support these additions.
Rearranged the `App` and `Layout` component definitions to improve
code readability and maintain a logical structure. This change
ensures consistent organization of components within the file.
Extend Babel's `include` paths to cover `src` directory and shared
`ui` package. This ensures proper transpilation of files across the
updated project structure.
Added ESLint-specific dependencies (@eslint/js, eslint,
eslint-plugin-react, typescript-eslint, globals) to improve linting
capabilities. Updated pnpm-lock.yaml to reflect these additions and
bump dependency versions. Removed outdated and deprecated packages
from the lockfile for cleanup.
Refactored ESLint configuration for improved readability and
consistency by aligning indentation and formatting. Disabled specific
 React rules and adjusted type usage for better development flow.
 Removed outdated eslint-disable comments from env.server.ts and
 generate-djb2-hash.ts.
@@ -374,24 +439,38 @@ packages:
resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==}
engines: {node: '>=6.9.0'}

'@babel/[email protected]':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"optimise" is a misspelling of "optimize"

'@babel/core': 7.26.0
'@babel/helper-annotate-as-pure': 7.25.9
'@babel/helper-member-expression-to-functions': 7.25.9
'@babel/helper-optimise-call-expression': 7.25.9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"optimise" is a misspelling of "optimize"

@@ -5088,23 +5820,41 @@
dependencies:
'@babel/types': 7.26.0

'@babel/[email protected]':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"optimise" is a misspelling of "optimize"

'@babel/[email protected]': {}

'@babel/[email protected]': {}

'@babel/[email protected](@babel/[email protected])':
dependencies:
'@babel/core': 7.26.0
'@babel/helper-environment-visitor': 7.22.20
'@babel/helper-member-expression-to-functions': 7.24.5
'@babel/helper-optimise-call-expression': 7.22.5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"optimise" is a misspelling of "optimize"

'@babel/types': 7.26.0
'@babel/core': 7.26.0
'@babel/helper-member-expression-to-functions': 7.25.9
'@babel/helper-optimise-call-expression': 7.25.9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"optimise" is a misspelling of "optimize"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"optimise" is a misspelling of "optimize"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"optimise" is a misspelling of "optimize"

'@babel/helper-optimise-call-expression': 7.22.5

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"optimise" is a misspelling of "optimize"

Introduced support for Backbone and CircleCI icons in the resume
dev-icons component. This enhances the icon library and improves the
visual representation for these technologies.
Simplified components by removing unnecessary `memo` usage across
multiple files. This reduces complexity and ensures components are
easier to read and maintain without sacrificing performance in these
contexts.
Simplify state initialization by removing redundant useMemo calls in
`education.tsx` and `skills.tsx`. This improves readability and
reduces overhead without changing functionality.
Replaced `useMemo` calls with direct array assignments to optimize
code readability and performance. Introduced explicit type annotation
 for `toggleExperiences` to improve type safety.
Replaced unnecessary useMemo and useCallback with direct
initialization and inline function definition. This improves code
readability and reduces complexity in the skills accordion logic.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 7 out of 20 changed files in this pull request and generated no comments.

Files not reviewed (13)
  • apps/web/package.json: Language not supported
  • packages/ui/package.json: Language not supported
  • apps/web/eslint.config.js: Evaluated as low risk
  • apps/web/src/root.tsx: Evaluated as low risk
  • apps/web/src/routes/resume/education.tsx: Evaluated as low risk
  • apps/web/src/routes/resume/experience.tsx: Evaluated as low risk
  • apps/web/src/routes/resume/experiences.tsx: Evaluated as low risk
  • apps/web/src/routes/resume/generate-djb2-hash.ts: Evaluated as low risk
  • apps/web/src/routes/resume/skills.tsx: Evaluated as low risk
  • apps/web/src/utils/env.server.ts: Evaluated as low risk
  • apps/web/vite.config.ts: Evaluated as low risk
  • packages/ui/.storybook/main.ts: Evaluated as low risk
  • packages/ui/eslint.config.js: Evaluated as low risk
@suddenlyGiovanni suddenlyGiovanni marked this pull request as ready for review December 13, 2024 22:32
@suddenlyGiovanni suddenlyGiovanni merged commit 7004e70 into main Dec 13, 2024
19 checks passed
@suddenlyGiovanni suddenlyGiovanni deleted the web/react-compiler branch December 13, 2024 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants